﻿using System;

namespace SharpSqlAnalyzer.nodes
{
	// Token: 0x0200031C RID: 796
	public class TObjectNameList : TParseTreeNodeList
	{
		// Token: 0x06001C9F RID: 7327 RVA: 0x00331FCA File Offset: 0x003301CA
		public void insertObjectNameAt(TObjectName objectName, int index)
		{
			base.insertElementAt(objectName, index);
			base.setChanged();
		}

		// Token: 0x06001CA0 RID: 7328 RVA: 0x00331FDA File Offset: 0x003301DA
		public virtual void removeObjectName(int index)
		{
			if (index >= 0 && index < base.size())
			{
				this.getObjectName(index).setChanged();
				base.removeElementAt(index);
			}
		}

		// Token: 0x170006A1 RID: 1697
		// (get) Token: 0x06001CA2 RID: 7330 RVA: 0x00332005 File Offset: 0x00330205
		// (set) Token: 0x06001CA1 RID: 7329 RVA: 0x00331FFC File Offset: 0x003301FC
		public virtual int ObjectType
		{
			get
			{
				return this.objectType;
			}
			set
			{
				this.objectType = value;
			}
		}

		// Token: 0x06001CA4 RID: 7332 RVA: 0x00332015 File Offset: 0x00330215
		public virtual void addObjectName(TObjectName objectReference)
		{
			if (this.objectType != 0 && this.objectType != 100 && objectReference.ObjectType == 0)
			{
				objectReference.ObjectType = this.objectType;
			}
			base.addElement(objectReference);
		}

		// Token: 0x170006A2 RID: 1698
		public TObjectName this[int pos]
		{
			get
			{
				if (pos < 0 || pos >= base.size())
				{
					throw new IndexOutOfRangeException();
				}
				return (TObjectName)this.elementAt(pos);
			}
		}

		// Token: 0x06001CA6 RID: 7334 RVA: 0x00332065 File Offset: 0x00330265
		public virtual TObjectName getObjectName(int position)
		{
			if (position < base.size())
			{
				return (TObjectName)this.elementAt(position);
			}
			return null;
		}

		// Token: 0x06001CA7 RID: 7335 RVA: 0x0033207E File Offset: 0x0033027E
		internal override void addParseTreeNode(object arg1)
		{
			this.addObjectName((TObjectName)arg1);
		}

		// Token: 0x06001CA8 RID: 7336 RVA: 0x0033208C File Offset: 0x0033028C
		public virtual int searchColumnReference(TObjectName cr)
		{
			int result = -1;
			for (int i = 0; i < base.size(); i++)
			{
				if (string.Compare(this.getObjectName(i).ToString(), cr.ToString()) == 0)
				{
					result = i;
					break;
				}
			}
			return result;
		}

		// Token: 0x06001CA9 RID: 7337 RVA: 0x003320CA File Offset: 0x003302CA
		public override void accept(TParseTreeVisitor v)
		{
			v.preVisit(this);
			v.postVisit(this);
		}

		// Token: 0x06001CAA RID: 7338 RVA: 0x003320DC File Offset: 0x003302DC
		public override void acceptChildren(TParseTreeVisitor v)
		{
			v.preVisit(this);
			for (int i = 0; i < base.size(); i++)
			{
				this.getObjectName(i).acceptChildren(v);
			}
			v.postVisit(this);
		}

		// Token: 0x04001A7B RID: 6779
		private int objectType;
	}
}
